package com.dmap.knowledge.controller.rpc;

import com.dmap.knowledge.dao.ArticleTagMapper;
import com.dmap.knowledge.po.ArticleTagExample;
import com.dmap.knowledge.service.ArticleTagService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

/**
 * \* User: silent
 * \* Date: 16/05/18 Time: 16:46
 * \* Description: 查询文章关联数
 * \
 */
@Api(value = "查询标签关联文章数", description = "查询标签关联文章数")
@Controller
@RequestMapping(value = "/rpc/dmap-knowledge-server/v1")
public class RunRecordRpc {

    @Resource
    private ArticleTagService articleTagService;

    @ResponseBody
    @ApiOperation(value = "查询标签关联文章数", notes = "查询标签关联文章数,放回关联文章数量")
    @RequestMapping(value = "/count/tag/articleNumber", method = RequestMethod.GET)
    public Integer countTagArticleNum(@RequestParam(value = "tagId") Long tagId) {
        return articleTagService.countArticleNumberByTagId(tagId);
    }
}

